var initCourseTab = (function(doc){

  var oCourseTabLks = doc.getElementsByClassName('course-tab-lk'),
      oCourseTabLksLen = oCourseTabLks.length;

  return {
    SearchCourse: function(){

    },

    tabClick: function(e){
      var e = e || window.event,
          tar = e.target || e.srcEemelt,
          className = tar.className;
      
      if(className === 'course-tab-lk'){
        for(var i = 0; i < oCourseTabLksLen; i++){
          item = oCourseTabLks[i];
          item.className = 'course-tab-lk';
        }

        tar.className += ' current';
      }
      
    }
  } 
})(document);

(function(doc){
  var oSerchInput = doc.getElementById('js-search-input'),
      oTabList = doc.getElementsByClassName('js-course-tab-list')[0];

  var init = function(){
    bindEvent();
  }

  function bindEvent(){
    oSerchInput.addEventListener('input', initCourseTab.SearchCourse, false);
    oTabList.addEventListener('click', initCourseTab.tabClick, false);
  }
  
  init();

})(document);


